Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autoreload option #1983

Merged
merged 9 commits into from
Feb 17, 2021
Merged

Add autoreload option #1983

merged 9 commits into from
Feb 17, 2021

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Feb 16, 2021

Adds an --autoreload option to panel serve which reloads the application when a change in a script/notebook is detected.

out.mp4

@MarcSkovMadsen
Copy link
Collaborator

I want this so badly as it will speed up my workflow a lot.

Does it only reload one module or all modules that change?

@philippjfr
Copy link
Member Author

Does it only reload one module or all modules that change?

Currently reloads the scripts you are serving but I'll be working on making that configurable.

@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Feb 16, 2021

You should consider whether more advanced reloading is worth it. I know from Streamlit that reloading nested modules can be difficult. They never got it working 100% even though it was one of the first bugs I reported.

@philippjfr
Copy link
Member Author

Can you clarify what you mean by "nested modules"?

@MarcSkovMadsen
Copy link
Collaborator

You can see a description of some of the problems here streamlit/streamlit#358

@philippjfr
Copy link
Member Author

I've now borrowed some code from streamlit after trying a couple of different approaches but I suspect we'll have the same limitations as they do.

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #1983 (3cad2bd) into master (bb8dbca) will decrease coverage by 0.19%.
The diff coverage is 59.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1983      +/-   ##
==========================================
- Coverage   84.90%   84.71%   -0.20%     
==========================================
  Files         160      162       +2     
  Lines       19522    19696     +174     
==========================================
+ Hits        16576    16686     +110     
- Misses       2946     3010      +64     
Impacted Files Coverage Δ
panel/command/serve.py 17.54% <9.09%> (-0.05%) ⬇️
panel/io/server.py 62.28% <14.28%> (-6.55%) ⬇️
panel/io/reload.py 69.41% <69.41%> (ø)
panel/config.py 51.65% <100.00%> (+0.14%) ⬆️
panel/tests/io/test_reload.py 100.00% <100.00%> (ø)
panel/io/state.py 57.50% <0.00%> (+1.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb8dbca...3cad2bd. Read the comment docs.

panel/io/server.py Outdated Show resolved Hide resolved
@philippjfr philippjfr merged commit a81d6bc into master Feb 17, 2021
@philippjfr philippjfr deleted the autoreload branch February 17, 2021 16:39
@MarcSkovMadsen
Copy link
Collaborator

Just testing out the autoreload feature. It seems to work really, really well. This will definitely speed up my development process.

And seeing errors show up in the browser instead of terminal is also just so nice.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants